Developers write software applications using one or more software development programs. Developers write source code that is needed to make the software application perform the desired functionality. Software applications that have a user interface allow an end user to interact with graphical menus and options in the completed application to achieve a desired result. Source code generally has to be written by developers during development of the software application to handle such user input, and then to perform the proper work in response to the user input.
For example, in the case of a completed customer service application, the end user might be able to select a search operation to search for all customer records for a given customer name. The software application would then have to process the search, access a database to find the matching records, and return the results to the end user. If such a search is processed on the user interface thread of the software application, then an hourglass may or may not be displayed depending on the status of the processing. For example, an hourglass may not be displayed if the application is completely blocked. In such a blocking scenario, all that may be displayed on the screen is a black rectangle or other indicator which designates that the user interface thread is blocked. During this blocked period, the user is not able to do anything else with the program since the user interface thread is totally occupied in the performance of the search.
As technology has advanced, multi-threaded applications and multi-processor computers can now be utilized. In other words, multiple threads of execution can be started at the same time, sometimes on multiple processors when available. One thread, for example, may be used to handle user input, and another thread may be used for performing worker tasks. In order to create multi-threaded applications, developers are challenged with writing complex source code that creates and manages the multiple threads. This source code typically needs to include functionality for passing arguments between the different threads, which may be running asynchronously over many different locations. Developers often write separate routines for the work that needs performed by separate threads. Due to the complexity of working with multiple threads, it is common for developers to use the multiple threads incorrectly or inefficiently, or to not even use multiple threads at all and just expect that users will be fine with infrequent user interface blocks.